i = 1
while i <=9:#输入9行，正序
	j = 1
	while j <= i:
		print ("{}*{}={:<4}".format(j,i,i*j),end=" ")
		j += 1
	i += 1
	print("")
print ("="*80)
m = 9
while m >=1:#输入9行，倒序
	n = 1
	while n <= m:
		print ("{}*{}={:<4}".format(n,m,n*m),end=" ")
		n += 1
	m -= 1
	print("")